package com.example.userdemo.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

@TableName(value = "user")
@Data
public class User {
    @TableId(value = "id",type = IdType.AUTO)
    @ExcelProperty(value = "id", index = 0)
    private Integer id;

    @ExcelProperty(value = "name", index = 1)
    private String name;

    @ExcelProperty(value = "sex", index = 2)
    private int sex;//0为女，男为1

    @ExcelProperty(value = "createtime", index = 3)
    private Date createTime;

    @ExcelProperty(value = "description", index = 4)
    private String description;

    public User(){};

    public User(int id, String name, int sex, Date time, String description){
        this.id = id;
        this.name =name;
        this.sex = sex;
        this.createTime = time;
        this.description = description;
    }

    public User(String name){
        this.name = name;
    }
}
